﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;

namespace ChuanPlus
{
    public class Stock : XPLiteObject
    {
        int fStockID;
        [Key(true)]
        public int StockID
        {
            get { return fStockID; }
            set { SetPropertyValue<int>("StockID", ref fStockID, value); }
        }
        Product fID;
        public Product ID
        {
            get { return fID; }
            set { SetPropertyValue<Product>("ID", ref fID, value); }
        }
        Warehouse fwarehouseID;
        public Warehouse warehouseID
        {
            get { return fwarehouseID; }
            set { SetPropertyValue<Warehouse>("warehouseID", ref fwarehouseID, value); }
        }
        double fQtyBalance;
        public double QtyBalance
        {
            get { return fQtyBalance; }
            set { SetPropertyValue<double>("QtyBalance", ref fQtyBalance, value); }
        }
        public Stock(Session session) : base(session) { }
        public Stock() : base(Session.DefaultSession) { }
        public override void AfterConstruction() { base.AfterConstruction(); }
        /// <summary>
        /// Initializes a new instance of the Stock class.
        /// </summary>
        /// <param name="fID"></param>
        /// <param name="fwarehouseID"></param>
        /// <param name="fQtyBalance"></param>
        public Stock(Product fID, Warehouse fwarehouseID, double fQtyBalance)
        {
            this.fID = fID;
            this.fwarehouseID = fwarehouseID;
            this.fQtyBalance = fQtyBalance;
        }
        /// <summary>
        /// Initializes a new instance of the Stock class.
        /// </summary>
        /// <param name="fID"></param>
        /// <param name="fwarehouseID"></param>
        /// <param name="fQtyBalance"></param>
        public Stock(Session s,Product fID, Warehouse fwarehouseID, double fQtyBalance):base(s)
        {
            this.fID = fID;
            this.fwarehouseID = fwarehouseID;
            this.fQtyBalance = fQtyBalance;
        }
    }

}
